import 'dart:convert';
import 'dart:ffi';

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'inappupdate_flutter_platform_interface.dart';

/// An implementation of [InappupdateFlutterPlatform] that uses method channels.
class MethodChannelInappupdateFlutter extends InappupdateFlutterPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('inappupdate_flutter');

  @override
  Future<String?> checkUpdate(Map data) async {
    return methodChannel.invokeMethod<String?>('checkUpdate', jsonEncode(data));
  }
}
